import React, { Component } from 'react'
import axios from 'axios'
export class App extends Component {
  state={
    list:[]
  }
  componentDidMount(){
    axios.get("/list").then(res=>{
      console.log(res);
      this.setState({list:res.data.data})
    })
  }
  render() {
    let {list} = this.state
    return (
      <div>
        App
        {
          list && list.map((item,index)=>{
            return <div key={index}>
              <p>id : {item.id}</p>
              <p>title : {item.title}</p>
            </div>
          })
        }
      </div>
    )
  }
}

export default App
